#!/usr/bin/env python
'''Find meaning of acronym'''

__author__ = "Miki Tebeka <miki.tebeka@gmail.com>"
__license__ = "BSD" # see LICENSE

import webbrowser

URL = "http://www.acronymfinder.com/af-query.asp?Acronym=%s"

def find_acronym(acronym):
    webbrowser.open(URL % acronym)

def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    from optparse import OptionParser

    parser = OptionParser("usage: %prog ACRONYM")

    opts, args = parser.parse_args(argv[1:])
    if len(args) != 1:
        parser.error("wrong number of arguments") # Will exit

    find_acronym(args[0])

if __name__ == "__main__":
    main()
